from django.conf.urls import url,include
from web.views import index,cart,orders,vip

urlpatterns = [
    url(r'^$',index.index,name='index'),# 首页
    url(r'^plist/(?P<page>[0-9]+)$',index.plist,name='plist'),#商品列表
    url(r'^pdetail/(?P<pid>[0-9]+)$',index.pdetail,name='pdetail'),#商品详情

    # 会员登陆
    url('^login$',index.login,name='login'),
    url('^dologin$',index.dologin,name='dologin'),
    url('^logout$',index.logout,name='logout'),
    # 会员注册
    url('^register$',index.register,name='register'),
    url('^doregister$',index.doregister,name='doregister'),

    # 购物车
    url('^cart$',cart.index,name='cart_index'),#浏览购物车
    url('^cart/add/(?P<gid>[0-9]+)$',cart.add,name='cart_add'),# 加入购物车
    url('^cart/del/(?P<gid>[0-9]+)$',cart.delete,name='cart_del'),# 从购物车中删除商品
    url('^cart/clear$',cart.clear,name='cart_clear'),# 清空购物车
    url('^cart/change$',cart.change,name='cart_change'),# 修改购物车数量

    # 订单
    url(r'^orders/add$', orders.add,name='orders_add'), #下订单
    url(r'^orders/confirm$', orders.confirm,name='orders_confirm'), #订单确认
    url(r'^orders/insert$', orders.insert,name='orders_insert'), #执行订单添加

    # 会员中心
    url(r'^vip/orders$', vip.viporders,name='vip_orders'), #会员中心我的订单
    url(r'^vip/orderstate$', vip.orderstate,name='vip_orderstate'), #修改订单状态（确认收货）
    url(r'^vip/info$', vip.info,name='vip_info'), #会员中心的个人信息
    url(r'^vip/update$', vip.update,name='vip_update'), #执行修改会员信息
    url(r'^vip/pwd$', vip.pwd,name='vip_pwd'), #重置密码表单
    url(r'^vip/pwdSave$', vip.pwdSave,name='vip_pwdSave'), #执行重置密码

]
